package filterDesignPattern;

/**
 * 
 * @author Anitta
 * Concrete class implementing interface Criteria to filter list of Employee object using age criteria.
 *
 */

import java.util.ArrayList;
import java.util.List;

import classes.Employee;


public class YoungCriteria implements Criteria{

	public List<Employee> filter(List<Employee> employee) {
		List<Employee> youngAdult = new ArrayList<Employee>();
		for(Employee e : employee) {
			if( (e.getAge()>=18) && (e.getAge()<=24)) {
				youngAdult.add(e);
			}
		}	
		return youngAdult;
	}

	
	}

